<?php
// +----------------------------------------------------------------------
// | Bwsaas
// +----------------------------------------------------------------------
// | Copyright (c) 2015~2020 http://www.buwangyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Gitee ( https://gitee.com/buwangyun/bwsaas )
// +----------------------------------------------------------------------
// | Author: buwangyun <hnlg666@163.com>
// +----------------------------------------------------------------------
// | Date: 2020-9-28 10:55:00
// +----------------------------------------------------------------------

namespace buwang\util\wechat;


/**
 * 微信小程序相关接口
 */
class WechatProgramHandle
{
    /**
     * 代商家管理小程序-获取基本信息
     */
    public static function getAccountBasicInfo($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);

        $res = $mini_program->code->httpPost('cgi-bin/account/getaccountbasicinfo');
        return $res;
    }

    /**
     * 代商家管理小程序-小程序认证
     */
    public static function wxAuth($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/sec/wxaauth', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-小程序认证重新提审
     */
    public static function wxReauth($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/sec/reauth', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-小程序认证进度查询
     */
    public static function wxQueryAuth($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/sec/queryauth', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-查询个人认证身份选项列表
     */
    public static function wxAuthidentitytree($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/sec/authidentitytree', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-小程序认证上传补充材料
     */
    public static function wxUploadAuthMaterial($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpUpload('wxa/sec/uploadauthmaterial', $data);
        return $res;
    }


    /**
     * 代商家管理小程序-查询人脸核身任务状态
     */
    public static function wxQueryIcpVerifyTask($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/icp/query_icp_verifytask', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-发起小程序管理员人脸核身
     */
    public static function wxCreateIcpVerifyTask($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/icp/create_icp_verifytask', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-获取单位性质
     */
    public static function wxQueryIcpSubjectTypes($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpGet('wxa/icp/query_icp_subject_types');
        return $res;
    }

    /**
     * 代商家管理小程序-获取证件类型
     */
    public static function wxQueryIcpCertificateTypes($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpGet('wxa/icp/query_icp_certificate_types');
        return $res;
    }

    /**
     * 代商家管理小程序-获取区域信息
     */
    public static function wxQueryIcpDistrictCode($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpGet('wxa/icp/query_icp_district_code');
        return $res;
    }

    /**
     * 代商家管理小程序-上传小程序备案媒体材料
     */
    public static function wxUploadIcpMedia($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/icp/upload_icp_media', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-申请小程序备案
     */
    public static function wxApplyIcpFiling($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/icp/apply_icp_filing', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-获取小程序备案状态及驳回原因
     */
    public static function wxGetIcpEntranceInfo($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('wxa/icp/get_icp_entrance_info');
        return $res;
    }


    /**
     * 代商家管理小程序-获取小程序用户隐私保护指引
     */
    public static function wxGetPrivacySetting($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('cgi-bin/component/getprivacysetting', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-设置小程序用户隐私保护指引
     */
    public static function wxSetPrivacySetting($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPostJson('cgi-bin/component/setprivacysetting', $data);
        return $res;
    }

    /**
     * 代商家管理小程序-获取隐私接口检测结果
     */
    public static function wxGetCodePrivacyInfo($member_miniapp_id)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpGet('wxa/security/get_code_privacy_info');
        return $res;
    }

    /**
     * 代商家管理小程序-获取授权账号详情
     */
    public static function authorizerInfo($member_miniapp_id, $data)
    {
        $WechatProgram = new WechatProgram();
        $mini_program = $WechatProgram->getWechatObj($member_miniapp_id);
        $res = $mini_program->code->httpPost('cgi-bin/component/api_get_authorizer_info', $data);
        return $res;
    }


}